﻿@using CoralNode.Core.Entity.Enums
@using CoralNode.MvcClient.Helper
@using Coralcode.Utils.Basic
@model CoralNode.Core.Entity.Domains.User.RoleDomain

@{
    ViewBag.Title = "Edit";
}
@Html.IncludePage("CoralAdmin/user", "_Left")
<div id="pbody">
    <div class="extra">
        <div class="pbody_top">
            <span class="ico ico_setting_system"></span><span class="t t_c">用户管理&nbsp;&nbsp;/&nbsp;&nbsp;<b
                class=" t_small f_no">添加角色</b></span>
        </div>
        <div id="main">
            <div class="local">
                <a href="/m/user/listRole" class="ico ico_back btn"></a>
            </div>
            <div class="content_tab extra_normal">  
                <div class="tablist extra_normal" data-js="tab">
                    <a href="#">主要信息</a>
                </div>
            </div>
            <form id="spform" action="/m/user/createRole" method="post" enctype="multipart/form-data">
                @if (@ViewBag.Msg != null)
                {
                    <div class="error_msg">
                        @ViewBag.Msg.Msg
                    </div>
                }
                <div class="pt_3 js_tabcnt">
                    <div class="table_form form_main ">
                        <div class="pl_2 pb_3">
                            @Html.AntiForgeryToken()
                            @Html.ValidationSummary(true)
                            <table>
                                <tbody>
                                    <tr>
                                        <th width="80">名称<span class="rq">*</span></th>
                                        <td>
                                            @Html.TextBoxFor(m => m.Name, new { @class = "text w_37 required" })
                                            <div class="exp ml_1">4-16个字符，支持英文小写、数字、下划线</div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>角色编码<span class="rq">*</span></th>
                                        <td>@Html.TextBoxFor(m => m.Code, new { @class = "text w_37 required" })
                                            <div class="exp ml_1">4-16个字符，支持英文小写、数字、下划线</div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>描述<span class="rq">*</span></th>
                                        <td>
                                            @Html.TextAreaFor(m => m.Description, new { @class = "w_58 h_10" })
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>状态</th>
                                        <td>
                                            <div class="slt js-select" name="Status" wd="264" swd="220">
                                                <div class="curr"><span></span></div>
                                                <div class="show">
                                                    <ul>
                                                        @foreach (var item in @ViewBag.StatusList)
                                                        {
                                                            if (Model.Status == @item.Value)
                                                            {
                                                                <li selected="selected" val="@item.Value"><a>@item.Key</a></li>
                                                            }
                                                            else
                                                            {
                                                                <li  val="@item.Value"><a>@item.Key</a></li>
                                                            }
                                                        }
                                                    </ul>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="submitbox p_2 extra_normal">
                    <input type="submit" class="btn_1" value="提    交" />
                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $('.nav_left_style2').find('li').eq(1).addClass('current');
    });
</script>
